package org.micropayment.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


/**
 *
 * @author jj
 */
@Entity
@Table(name = "ProviderResource")
@NamedQueries({
    @NamedQuery(name = "ProviderResource.findAll", query = "SELECT p FROM ProviderResource p"),
    @NamedQuery(name = "ProviderResource.findById", query = "SELECT p FROM ProviderResource p WHERE p.id = :id")})
public class ProviderResource implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private String id;
    @Basic(optional = false)
    @Column(name = "consumerKey", nullable = false, length = 255)
    private String consumerKey;
    @Basic(optional = false)
    @Column(name = "signatureMethod", nullable = false, length = 50)
    private String signatureMethod;
    @Basic(optional = false)
    @Column(name = "typeofsecret")
    @Enumerated(value = EnumType.STRING)
    private TypeOfSecret typeofsecret;
    @Basic(optional = false)
    @Column(name = "sharedConsumerSecret", nullable = false, length = 255)
    private String sharedConsumerSecret;
    @Basic(optional = false)
    @Column(name = "requestTokenUrl", nullable = false, length = 255)
    private String requestTokenURL;
    @Column(name = "requestTokenHttpMethod", nullable = false, length = 50)
    private String requestTokenHttpMethod;
    @Basic(optional = false)
    @Column(name = "userAuthorizationUrl", nullable = false, length = 255)
    private String userAuthorizationURL;
    @Basic(optional = false)
    @Column(name = "accessTokenUrl", nullable = false, length = 255)
    private String accessTokenURL;
    @Column(name = "accessTokenHttpMethod", nullable = false, length = 50)
    private String accessTokenHttpMethod;
    @Column(name = "acceptsAuthorizationHeader")
    private Boolean acceptsAuthorizationHeader;
    @Column(name = "authorizationHeaderRealm", length = 50)
    private String authorizationHeaderRealm;
    @Column(name = "use10a")
    private Boolean use10a; 

    public ProviderResource() {
    }

    public ProviderResource(String id) {
        this.id = id;
    }

    public ProviderResource(String id, String consumerKey, String sharedConsumerSecret, String requestTokenURL, String userAuthorizationURL, String accessTokenURL) {
        this.id = id;
        this.consumerKey = consumerKey;
        this.sharedConsumerSecret = sharedConsumerSecret;
        this.requestTokenURL = requestTokenURL;
        this.userAuthorizationURL = userAuthorizationURL;
        this.accessTokenURL = accessTokenURL;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getConsumerKey() {
        return consumerKey;
    }

    public void setConsumerKey(String consumerKey) {
        this.consumerKey = consumerKey;
    }

    public String getSharedConsumerSecret() {
        return sharedConsumerSecret;
    }

    public void setSharedConsumerSecret(String sharedConsumerSecret) {
        this.sharedConsumerSecret = sharedConsumerSecret;
    }

    public String getRequestTokenURL() {
        return requestTokenURL;
    }

    public void setRequestTokenURL(String requestTokenUrl) {
        this.requestTokenURL = requestTokenURL;
    }

    public String getUserAuthorizationURL() {
        return userAuthorizationURL;
    }

    public void setUserAuthorizationURL(String userAuthorizationUrl) {
        this.userAuthorizationURL = userAuthorizationURL;
    }

    public String getAccessTokenURL() {
        return accessTokenURL;
    }

    public void setAccessTokenURL(String accessTokenURL) {
        this.accessTokenURL = accessTokenURL;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProviderResource)) {
            return false;
        }
        ProviderResource other = (ProviderResource) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.micropayment.model.ProviderResource[id=" + id + "]";
    }

    /**
     * @return the signatureMethod
     */
    public String getSignatureMethod() {
        return signatureMethod;
    }

    /**
     * @param signatureMethod the signatureMethod to set
     */
    public void setSignatureMethod(String signatureMethod) {
        this.signatureMethod = signatureMethod;
    }

    /**
     * @return the typeofsecret
     */
    public TypeOfSecret getTypeofsecret() {
        return typeofsecret;
    }

    /**
     * @param typeofsecret the typeofsecret to set
     */
    public void setTypeofsecret(TypeOfSecret typeofsecret) {
        this.typeofsecret = typeofsecret;
    }

    /**
     * @return the requestTokenHttpMethod
     */
    public String getRequestTokenHttpMethod() {
        return requestTokenHttpMethod;
    }

    /**
     * @param requestTokenHttpMethod the requestTokenHttpMethod to set
     */
    public void setRequestTokenHttpMethod(String requestTokenHttpMethod) {
        this.requestTokenHttpMethod = requestTokenHttpMethod;
    }

    /**
     * @return the accessTokenHttpMethod
     */
    public String getAccessTokenHttpMethod() {
        return accessTokenHttpMethod;
    }

    /**
     * @param accessTokenHttpMethod the accessTokenHttpMethod to set
     */
    public void setAccessTokenHttpMethod(String accessTokenHttpMethod) {
        this.accessTokenHttpMethod = accessTokenHttpMethod;
    }

    /**
     * @return the acceptsAuthorizationHeader
     */
    public Boolean getAcceptsAuthorizationHeader() {
        return acceptsAuthorizationHeader;
    }

    /**
     * @param acceptsAuthorizationHeader the acceptsAuthorizationHeader to set
     */
    public void setAcceptsAuthorizationHeader(Boolean acceptsAuthorizationHeader) {
        this.acceptsAuthorizationHeader = acceptsAuthorizationHeader;
    }

    /**
     * @return the authorizationHeaderRealm
     */
    public String getAuthorizationHeaderRealm() {
        return authorizationHeaderRealm;
    }

    /**
     * @param authorizationHeaderRealm the authorizationHeaderRealm to set
     */
    public void setAuthorizationHeaderRealm(String authorizationHeaderRealm) {
        this.authorizationHeaderRealm = authorizationHeaderRealm;
    }

    /**
     * @return the use10a
     */
    public Boolean getUse10a() {
        return use10a;
    }

    /**
     * @param use10a the use10a to set
     */
    public void setUse10a(Boolean use10a) {
        this.use10a = use10a;
    }

}
